Optimal. Leaf size=98 \[ \frac{a^2 \cos ^3(c+d x)}{3 d}-\frac{2 a^2 \cot (c+d x)}{d}-\frac{a^2 \sin (c+d x) \cos (c+d x)}{d}+\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a^2 \cot (c+d x) \csc (c+d x)}{2 d}-3 a^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.157049, antiderivative size = 98, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 8, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.296, Rules used = {2872, 3770, 3767, 8, 3768, 2638, 2635, 2633} \[ \frac{a^2 \cos ^3(c+d x)}{3 d}-\frac{2 a^2 \cot (c+d x)}{d}-\frac{a^2 \sin (c+d x) \cos (c+d x)}{d}+\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{a^2 \cot (c+d x) \csc (c+d x)}{2 d}-3 a^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2872
Rule 3770
Rule 3767
Rule 8
Rule 3768
Rule 2638
Rule 2635
Rule 2633
Rubi steps
\begin{align*} \int \cos (c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac{\int \left (-4 a^6-a^6 \csc (c+d x)+2 a^6 \csc ^2(c+d x)+a^6 \csc ^3(c+d x)-a^6 \sin (c+d x)+2 a^6 \sin ^2(c+d x)+a^6 \sin ^3(c+d x)\right ) \, dx}{a^4}\\ &=-4 a^2 x-a^2 \int \csc (c+d x) \, dx+a^2 \int \csc ^3(c+d x) \, dx-a^2 \int \sin (c+d x) \, dx+a^2 \int \sin ^3(c+d x) \, dx+\left (2 a^2\right ) \int \csc ^2(c+d x) \, dx+\left (2 a^2\right ) \int \sin ^2(c+d x) \, dx\\ &=-4 a^2 x+\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{d}+\frac{a^2 \cos (c+d x)}{d}-\frac{a^2 \cot (c+d x) \csc (c+d x)}{2 d}-\frac{a^2 \cos (c+d x) \sin (c+d x)}{d}+\frac{1}{2} a^2 \int \csc (c+d x) \, dx+a^2 \int 1 \, dx-\frac{a^2 \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}-\frac{\left (2 a^2\right ) \operatorname{Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}\\ &=-3 a^2 x+\frac{a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac{a^2 \cos ^3(c+d x)}{3 d}-\frac{2 a^2 \cot (c+d x)}{d}-\frac{a^2 \cot (c+d x) \csc (c+d x)}{2 d}-\frac{a^2 \cos (c+d x) \sin (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 2.1272, size = 158, normalized size = 1.61 \[ \frac{a^2 (\sin (c+d x)+1)^2 \left (6 \cos (c+d x)+2 \cos (3 (c+d x))+3 \left (-4 \sin (2 (c+d x))+8 \tan \left (\frac{1}{2} (c+d x)\right )-8 \cot \left (\frac{1}{2} (c+d x)\right )-\csc ^2\left (\frac{1}{2} (c+d x)\right )+\sec ^2\left (\frac{1}{2} (c+d x)\right )-4 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )+4 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )-24 c-24 d x\right )\right )}{24 d \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.081, size = 161, normalized size = 1.6 \begin{align*} -{\frac{{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{6\,d}}-{\frac{{a}^{2}\cos \left ( dx+c \right ) }{2\,d}}-{\frac{{a}^{2}\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{2\,d}}-2\,{\frac{{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{5}}{d\sin \left ( dx+c \right ) }}-2\,{\frac{{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{3}\sin \left ( dx+c \right ) }{d}}-3\,{\frac{{a}^{2}\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{d}}-3\,{a}^{2}x-3\,{\frac{c{a}^{2}}{d}}-{\frac{{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{5}}{2\,d \left ( \sin \left ( dx+c \right ) \right ) ^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.65571, size = 204, normalized size = 2.08 \begin{align*} \frac{2 \,{\left (2 \, \cos \left (d x + c\right )^{3} + 6 \, \cos \left (d x + c\right ) - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} a^{2} - 12 \,{\left (3 \, d x + 3 \, c + \frac{3 \, \tan \left (d x + c\right )^{2} + 2}{\tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} a^{2} + 3 \, a^{2}{\left (\frac{2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - 4 \, \cos \left (d x + c\right ) + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.61137, size = 427, normalized size = 4.36 \begin{align*} \frac{4 \, a^{2} \cos \left (d x + c\right )^{5} - 36 \, a^{2} d x \cos \left (d x + c\right )^{2} - 4 \, a^{2} \cos \left (d x + c\right )^{3} + 36 \, a^{2} d x + 6 \, a^{2} \cos \left (d x + c\right ) + 3 \,{\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) - 3 \,{\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) - 12 \,{\left (a^{2} \cos \left (d x + c\right )^{3} - 3 \, a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \,{\left (d \cos \left (d x + c\right )^{2} - d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.38414, size = 240, normalized size = 2.45 \begin{align*} \frac{3 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 72 \,{\left (d x + c\right )} a^{2} - 12 \, a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + 24 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + \frac{3 \,{\left (6 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 8 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - a^{2}\right )}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2}} + \frac{16 \,{\left (3 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 3 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 3 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a^{2}\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{3}}}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]